package Demo5;

public class Test {

    public static void test01(Animal animal){
        animal.eat();
    }

    public static void test02(IRun r1){
        r1.run();
    }

    public static void main(String[] args) {
        Dog dog=new Dog("小才",12);
        Duck duck=new Duck("唐老鸭",9);
        test02(dog);
        test02(duck);
        test02(new Robot());
    }
    public static void main1(String[] args) {
        Dog dog=new Dog("小才",12);
        Bird bird=new Bird("菲菲",4);
        Duck duck=new Duck("唐老鸭",9);
        test01(dog);
        test01(bird);
        test01(duck);
    }
}
